import wepy from '@wepy/core'
export default {
  data: {
    swiperList: [],
    catesList: []
  },
  created () {
    this.getSwiperData()
    this.getCatesData()
  },
  methods: {
    async getSwiperData () {
      var { data } = await wepy.get('/home/swiperdata')
      if (data.meta.status !== 200) {
        return wepy.baseToast()
      }
      this.swiperList = data.message
      wepy.baseToast('数据获取成功')
    },
    // console.log(data)

    async getCatesData () {
      var { data } = await wepy.get('/home/catitems')
      console.log(data)
      if (data.meta.status !== 200) {
        return wepy.baseToast()
      }
      this.catesList = data.message
      wepy.baseToast('分类数据获取成功')
    }
  }
}
